# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=telepathy-glib
pkgver=0.24.1
pkgrel=1
pkgdesc="Library for GLib-based Telepathy components"
url="https://telepathy.freedesktop.org"
arch="all"
license="LGPL-2.1-or-later"
makedepends="dbus-glib-dev intltool libxslt python3 glib-dev diffutils vala
	gobject-introspection-dev automake autoconf"
options="!check" # Glib-ERROR duplicate test case path => broken upstream
subpackages="$pkgname-dev $pkgname-doc"
source="https://telepathy.freedesktop.org/releases/telepathy-glib/telepathy-glib-$pkgver.tar.gz"

prepare() {
	default_prepare
	env LANG=C grep -rl python . | \
		xargs sed -i \
			-e 's|/usr/bin/python$|/usr/bin/python3|'  \
			-e 's|/usr/bin/env[ \t]*python$|/usr/bin/python3|'

	autoreconf -fi
}

build() {
	export PYTHON=python3
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-vala-bindings
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="2fed94f76a19d6069f671cdd45d2fd8a4b4ad27c4601aff66041ca205456be397c76a86f92cc9bf20fa4eb6d4c15a67ed8196644c143c37e945f382229a63335  telepathy-glib-0.24.1.tar.gz"
